﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ParieurPro.DAL.DatabaseModel;
using ParieurPro.DAL;

namespace MyBet.Web
{
    public partial class iPhoneLogin : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            Response.CacheControl = "no-cache";
            Response.AddHeader("Pragma", "no-cache");
            Response.Expires = -1;

            if (!IsPostBack)
            {
                if (Session["TeamsDictionary"] == null)
                {
                    using (MyBetDBEntities dbContext = new MyBetDBEntities())
                    {
                        List<Teams> teams = TeamObject.Load(dbContext);
                        Dictionary<int, string> teamsDictionary = new Dictionary<int, string>();
                        foreach (Teams item in teams)
                        {
                            teamsDictionary.Add(item.TeamId, item.ShortName);
                        }
                        Session["TeamsDictionary"] = teamsDictionary;
                    }
                }
            }
        }

        /// <summary>
        /// L'onglet actif a changé
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void TabContainer1_ActiveTabChanged(object sender, EventArgs e)
        {
        }

        protected void TabContainer1_Load(object sender, EventArgs e)
        {
            // Chargement des événements
            return;
        }



    }
}